package com.lam.system.entity;

import java.util.Date;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import javax.validation.constraints.Size;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.lam.common.base.domain.BaseEntity;
import com.lam.common.components.dict.annotation.Dict;
import com.lam.common.utils.DateUtil;
import com.lam.common.validate.group.Add;

/**
 * 角色菜单对象 sys_role_menu
 * 
 * @author admin
 * @date 2022-09-20
 */
@TableName("sys_role_menu")
public class SysRoleMenu implements BaseEntity{

    /** 主键 */
	@Null(groups = Add.class, message="id必须为空")
    @TableId(type = IdType.AUTO)
    private String id;
    
    /** 角色id */
    @NotBlank(message = "角色id不能为空")
    @Size(max = 32, message = "角色id长度不能超过32个字符")
    private String roleId;

    /** 权限id */
    @NotBlank(message = "权限id不能为空")
    @Size(max = 32, message = "权限id长度不能超过32个字符")
    private String menuId;

    /** 更新人 */
    private String updateBy;

    /** 更新时间 */
    @JsonFormat(pattern = DateUtil.PATTERN_DEFAULT)
    @TableField(fill = FieldFill.UPDATE)
    private Date updateTime;

    /** 类型(1-后端授权，2-前端授权) */
    @NotNull(message = "类型不能为空")
    @Dict(dictCode = "role_mune_type")
    private Integer type;


    public void setId(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    } 

    public void setRoleId(String roleId) {
        this.roleId = roleId;
    }

    public String getRoleId() {
        return roleId;
    }    
    
    public void setMenuId(String menuId) {
        this.menuId = menuId;
    }

    public String getMenuId() {
        return menuId;
    }    
    
    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
    }

    public String getUpdateBy() {
        return updateBy;
    }    
    
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }    
    
    public void setType(Integer type) {
        this.type = type;
    }

    public Integer getType() {
        return type;
    }    
    

}
